package com.huawei.hms.auth.api.signin.internal.a;

import android.content.Context;
import com.huawei.hms.api.Api;
import com.huawei.hms.api.Api$ApiOptions$Optional;
import com.huawei.hms.api.HuaweiApiAvailability;
import com.huawei.hms.auth.api.signin.internal.c;
import com.huawei.hms.common.HuaweiApi;
import com.huawei.hms.support.api.entity.core.CoreNaming;
import com.huawei.hms.support.hianalytics.HiAnalyticsClient;
import com.huawei.hms.support.log.HMSLog;
import com.huawei.hms.utils.Util;
import org.json.JSONException;
import org.json.JSONObject;

public class b extends HuaweiApi<a> {
    private static final Api<a> a = new Api(HuaweiApiAvailability.HMS_API_NAME_GAME);
    private static final a c = new a();
    private Context b;

    public static class a implements Api$ApiOptions$Optional {
    }

    public b(Context context) {
        super(context, a, c, new c());
        this.b = context;
        setKitSdkVersion(com.huawei.hms.auth.api.signin.internal.c.a.a());
    }

    public void a() {
        HMSLog.i("SignInNoticeClientImpl", "request Jos Notice.");
        String reportEntry = HiAnalyticsClient.reportEntry(getContext(), CoreNaming.GETNOTICE, com.huawei.hms.auth.api.signin.internal.c.a.a());
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("noticeType", 1);
            jSONObject.put("hmsSdkVersionName", HuaweiApiAvailability.HMS_SDK_VERSION_NAME);
            jSONObject.put("cpId", Util.getCpId(this.b));
            doWrite(new a(CoreNaming.GETNOTICE, jSONObject.toString(), reportEntry));
        } catch (JSONException e) {
            HMSLog.w("SignInNoticeClientImpl", "build Notice request meet JSONException.");
        }
    }
}
